function cover_fixcontentheight(id){var el=$("#rec"+id),hcover=el.find(".t-cover").height(),hcontent,hcontent;if((hcontent=el.find("div[data-hook-content]").outerHeight())>300&&hcover1e3&&(hcontent+=100),console.log("auto correct cover height: "+hcontent),el.find(".t-cover").height(hcontent),el.find(".t-cover__filter").height(hcontent),el.find(".t-cover__carrier").height(hcontent),el.find(".t-cover__wrapper").height(hcontent),window.isMobile||setTimeout((function(){var divvideo=el.find(".t-cover__carrier");divvideo.find("iframe").length>0&&(console.log("correct video from cover_fixcontentheight"),setWidthHeightYoutubeVideo(divvideo,hcontent+"px")),divvideo.find("video").length>0&&console.log("correct html5video from cover_fixcontentheight")}),2e3),"function"==typeof window.t_lazyload_updateResize_elem))try{window.t_lazyload_updateResize_elem(el.find(".t-cover__carrier"))}catch(e){console.log("error:"+e)}}function cover_checkIsFixForBackgroundNeeded(id){var rec=document.body.querySelector("#rec"+id);if(rec){var coverCarrier=rec.querySelector(".t-cover__carrier"),youtubeUrl,mp4Url,webmUrl;null!==coverCarrier&&(youtubeUrl=coverCarrier.getAttribute("data-content-video-url-youtube"),mp4Url=coverCarrier.getAttribute("data-content-video-url-mp4"),webmUrl=coverCarrier.getAttribute("data-content-video-url-webm"));var is_safari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),isMobile;return!(window.isMobile||/Macintosh/.test(navigator.userAgent)&&"ontouchend"in document||!is_safari||youtubeUrl||mp4Url||webmUrl||!coverCarrier||"fixed"!==coverCarrier.getAttribute("data-content-cover-parallax")||window["cover"+id+"fixbackgroundstyles"])}}function cover_fixBackgroundFixedNode(id){if(cover_checkIsFixForBackgroundNeeded(id)){var rec=document.body.querySelector("#rec"+id),parent=document.body.querySelector("#rec"+id+" .t-cover").parentNode;if(console.log("new fix node background-position: fixed"),!window.cover_fixBackgroundStyles){var css=".t-cover__container {position: relative;}.t-cover__container .t-cover {clip: rect(0, auto, auto, 0);position: absolute;top: 0;left: 0;width: 100%;height: 100% !important;}.t-cover__container .t-cover .t-cover__carrier {position: fixed;display: block;top: 0;left: 0;width: 100%;height: 100%!important;background-size: cover;background-position: center center;transform: translateZ(0);will-change: transform;}",head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");head.appendChild(style),style.type="text/css",style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css)),window.cover_fixBackgroundStyles=!0}var newWrapper=document.createElement("div");newWrapper.classList.add("t-cover__container"),parent.prepend(newWrapper);var cover=rec.querySelector(".t-cover"),coverHeight=cover.style.height;newWrapper.style.height=coverHeight,newWrapper.append(cover);var specificCovers,classContainer={275:".t256__video-container",286:".t266__video-container",337:".t-container",906:".t906__video-container"}[rec.getAttribute("data-record-type")];if(void 0!==classContainer){var container=rec.querySelector(classContainer);newWrapper.append(container)}window["cover"+id+"fixbackgroundnodes"]=!0}}function cover_fixBackgroundFixedStyles(id){var rec=document.body.querySelector("#rec"+id);if(cover_checkIsFixForBackgroundNeeded(id)){console.log("new fix style background-position: fixed");var newWrapper=rec.querySelector(".t-cover__container"),cover=rec.querySelector(".t-cover"),coverHeight=cover.style.height;cover.style.height=0,newWrapper.style.height=coverHeight,window["cover"+id+"fixbackgroundstyles"]=!0}}function cover_onFuncLoad(funcName,okFunc){"function"==typeof funcName?okFunc():setTimeout((function checkFuncExist(){if("function"!=typeof funcName){if("complete"===document.readyState&&"function"!=typeof funcName)throw new Error(funcName+" is undefined");setTimeout(checkFuncExist,100)}else okFunc()}))}!function($){var $window=$(window),windowHeight=$window.height();$window.resize((function(){windowHeight=$window.height()})),$.fn.parallax=function(speedFactor,outerHeight){var $this=$(this),getHeight,firstTop,isWebkitTransform=void 0!==document.body.style["-webkit-transform"];function update(){var pos=$window.scrollTop();$this.each((function(){var $element=$(this),top=$element.offset().top,height=getHeight($element),rect=this.getBoundingClientRect();if(!(top+heightpos+windowHeight)){var backgroundVerticalShift=-1*Math.round(rect.top*speedFactor);isWebkitTransform?this.style["-webkit-transform"]="translateY("+backgroundVerticalShift+"px)":this.style.top=backgroundVerticalShift+"px"}}))}isWebkitTransform&&$this.css("position","relative"),window.correctFirstTop4Parallax=function(){$this.each((function(){firstTop=$this.offset().top}))},window.correctFirstTop4Parallax(),getHeight=outerHeight?function(jqo){return jqo.outerHeight(!0)}:function(jqo){return jqo.height()},(arguments.length<1||null===speedFactor)&&(speedFactor=.1),(arguments.length<2||null===outerHeight)&&(outerHeight=!0),update(),$(window).resize(window.correctFirstTop4Parallax),$window.bind("scroll",update).resize(update),"complete"!==document.readyState&&window.addEventListener("load",(function(){update()}))}}(jQuery),function($){window.cover_init=function(id){$(document).ready((function(){var cover_carrier=document.body.querySelector("#coverCarry"+id),el=$(cover_carrier),backgroundurl=el.attr("data-content-cover-bg"),height=el.attr("data-content-cover-height"),parallax=el.attr("data-content-cover-parallax"),videomp4=el.attr("data-content-video-url-mp4"),videowebm=el.attr("data-content-video-url-webm"),youtubeid=el.attr("data-content-video-url-youtube"),noloop=el.attr("data-content-video-noloop"),nomute=el.attr("data-content-video-nomute"),bgbase64=el.attr("data-content-bg-base64"),video_nocover=el.attr("data-content-video-nocover");backgroundurl||(backgroundurl=""),height||(height=""),parallax||(parallax=""),videomp4||(videomp4=""),videowebm||(videowebm=""),youtubeid||(youtubeid=""),noloop||(noloop=""),nomute||(nomute=""),youtubeid||(youtubeid=""),bgbase64||(bgbase64=""),video_nocover&&"yes"==video_nocover&&(videomp4="",videowebm="",youtubeid=""),!window.isMobile||""==videowebm&&""==videomp4&&""==youtubeid||el.css("background-image","url('"+backgroundurl+"')"),setTimeout((function(){cover_fixcontentheight(id),cover_fixBackgroundFixedStyles(id)}),500),cover_fixBackgroundFixedNode(id);var clogo=$("#rec"+id).find("img[data-hook-clogo]");if(clogo.length&&clogo.load((function(){setTimeout((function(){cover_fixcontentheight(id),cover_fixBackgroundFixedStyles(id)}),500)})),window.isMobile&&$(window).on("orientationchange",(function(){cover_fixcontentheight(id),cover_fixBackgroundFixedStyles(id)})),(""!==videomp4||""!==videowebm||""!==youtubeid)&&!window.isMobile)if(""!=youtubeid||""==videomp4&&""==videowebm){if(""!=youtubeid){var cotimer;el.css("background-color","#000000"),el.css("background-image",""),el.attr("data-content-cover-bg","");var flagprocessed=0,wnd;(wnd=$(window)).scroll((function(){cotimer&&window.clearTimeout(cotimer),cotimer=window.setTimeout((function(){var a,b,c,d;(flagprocessed=el.find("iframe").length)>0||(a=el.offset().top,b=el.height(),(c=wnd.scrollTop())+(d=wnd.height())>a-500&&c<=a+b+500&&processYoutubeVideo(cover_carrier,height))}),100)})),wnd.scroll()}}else{el.css("background-color","#000000"),el.css("background-image","url('https://tilda.ws/img/spinner-white.gif')"),el.css("background-size","auto"),el.attr("data-content-cover-bg","");var loop=!1;loop=""==noloop;var muted=!0;muted=""==nomute;var height_more_vh="",cotimer;"fixed"==parallax&&(height.indexOf("vh")>-1&&parseInt(height)>100&&(el.css("height","100vh"),height_more_vh="yes"),height.indexOf("px")>-1&&parseInt(height)>$(window).height()&&(el.css("height","100vh"),height_more_vh="yes"));var flagprocessed="",wnd=$(window),prnt=el.parent();wnd.scroll((function(){var aa,bb,cc,dd;(cotimer&&window.clearTimeout(cotimer),cotimer=window.setTimeout((function(){var a,b,c,d;flagprocessed>0||(a=el.offset().top,b=el.height(),(c=wnd.scrollTop())+(d=wnd.height())>a-500&&c<=a+b+500&&cover_onFuncLoad(el.videoBG,(function(){var vid=el.videoBG({mp4:videomp4,webm:videowebm,poster:"",preload:"none",autoplay:"true",loop:loop,volume:1,scale:!0,zIndex:0,width:"100%"});vid.setAttribute("muted",muted),vid.setAttribute("playsinline",""),videoLoadProcessor.registerNewVideo(vid),flagprocessed=1})))}),100),"fixed"==parallax&&"yes"==height_more_vh)&&(aa=prnt.offset().top,bb=prnt.height(),(cc=wnd.scrollTop())>=aa+bb-(dd=wnd.height())?(el.css("position","absolute"),el.css("bottom","0px"),el.css("top","auto")):cc>=aa?(el.css("position","fixed"),el.css("top","0px")):cc").attr("src",backgroundurl).load((function(){$(this).remove(),el.css("background-image","url('"+backgroundurl+"')"),el.css("opacity","1"),bg_already="yes"})),"yes"!=bg_already&&(el.css("background-image",""),el.css("opacity","0"),el.css("transition","opacity 25ms"))}var coverarrow=$("#rec"+id).find(".t-cover__arrow-wrapper");coverarrow.length>0&&coverarrow.click((function(){var recheight=$("#rec"+id).height();recheight>0&&$("html, body").animate({scrollTop:$("#rec"+id).offset().top+recheight},500)}))}))},$(document).ready((function(){var curMode;"edit"!=$(".t-records").attr("data-tilda-mode")&&$(".t-cover__carrier").each((function(){var id=$(this).attr("data-content-cover-id");id>0&&cover_init(id)}))}))}(jQuery);